-
Notifications
You must be signed in to change notification settings - Fork 0
feat: interactive commands support #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis PR implements interactive command support and fixes a bug in stdout/stderr handling. The main changes involve adding a waitgroup to properly manage goroutines for stdout/stderr processing and introducing a new 'interactive' flag for tasks that require user input. Sequence diagram for stdout/stderr handling with waitgroupsequenceDiagram
participant Task
participant StdoutGoroutine
participant StderrGoroutine
participant WaitGroup
Task->>WaitGroup: Add goroutines
Task->>StdoutGoroutine: Start stdout goroutine
Task->>StderrGoroutine: Start stderr goroutine
StdoutGoroutine->>StdoutGoroutine: Read stdout
StdoutGoroutine->>Task: Write to stdout
StdoutGoroutine->>WaitGroup: Done
StderrGoroutine->>StderrGoroutine: Read stderr
StderrGoroutine->>Task: Write to stderr
StderrGoroutine->>WaitGroup: Done
WaitGroup->>Task: Wait for goroutines to finish
Updated class diagram for cmdArgs and ParsedTaskclassDiagram
class cmdArgs {
+string cmd
+bool interactive
+io.Writer stdout
+io.Writer stderr
}
class ParsedTask {
+string[] Shell
+string WorkingDir
+map<string, string> Env
+bool Interactive
+CommandJson[] Commands
}
note for cmdArgs "Added 'interactive' flag to support interactive commands"
note for ParsedTask "Added 'Interactive' attribute to handle interactive tasks"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nxtcoder17 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider removing the commented out debug logging lines to keep the code clean
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
fixes issue with dumping stdout and stderr of commands, there was a bug in current implementation, as goroutines for reading and dumping stdout ere not going through a waitgroup, which caused them to abruptly exit, without logging the remaining stuffs
a6a8b79 to
652ecf4
Compare
fixes issue with dumping stdout and stderr of commands, there was a bug in current implementation, as goroutines for reading and dumping stdout ere not going through a waitgroup, which caused them to abruptly exit, without logging the remaining stuffs
Resolves #21
Summary by Sourcery
Introduce support for interactive commands by adding an 'interactive' flag to task configurations. Fix a bug related to premature goroutine exits when handling stdout and stderr. Enhance logging by adding task-specific prefixes and improve handling of line breaks. Add tests to validate the new interactive task functionality.
New Features:
Bug Fixes:
Enhancements:
Tests: